﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NortwindDBConnection
{
    public class NorthwindDAO
    {
        public static IEnumerable<Employee> FetchAllDBEmployees()
        {
            NorthwindDataContext context = new NorthwindDataContext();
            List<Employee> employees = (from i in context.Employees
                                        select i)
                                        .ToList<Employee>();
            return employees;
        }

        public static IEnumerable<Order> FetchDBOrderIDsByEmployeeID(int employeeID)
        {
            NorthwindDataContext context = new NorthwindDataContext();
            List<Order> orders = (from i in context.Orders
                                  where i.EmployeeID==employeeID
                                  select i).ToList<Order>();
            return orders;
        }
    }
}